home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / scheme / schmdtrp / scheme_d.lha / comint.elc < prev    next >
Encoding:
Text File  |  1993-07-16  |  23.3 KB  |  380 lines

  1.  
  2. (provide (quote comint))
  3.  
  4. (defconst comint-version "2.03")
  5.  
  6. (defvar comint-prompt-regexp "^" "\
  7. Regexp to recognise prompts in the inferior process.
  8. Defaults to \"^\", the null string at BOL.
  9.  
  10. Good choices:
  11.   Canonical Lisp: \"^[^> ]*>+:? *\" (Lucid, franz, kcl, T, cscheme, oaklisp)
  12.   Lucid Common Lisp: \"^\\(>\\|\\(->\\)+\\) *\"
  13.   franz: \"^\\(->\\|<[0-9]*>:\\) *\"
  14.   kcl: \"^>+ *\"
  15.   shell: \"^[^#$%>]*[#$%>] *\"
  16.   T: \"^>+ *\"
  17.  
  18. This is a good thing to set in mode hooks.")
  19.  
  20. (defvar input-ring-size 30 "\
  21. Size of input history ring.")
  22.  
  23. (defvar comint-get-old-input (function comint-get-old-input-default) "\
  24. Function that submits old text in comint mode.
  25. This function is called when return is typed while the point is in old text.
  26. It returns the text to be submitted as process input.  The default is
  27. comint-get-old-input-default, which grabs the current line, and strips off
  28. leading text matching comint-prompt-regexp")
  29.  
  30. (defvar comint-input-sentinel (function ignore) "\
  31. Called on each input submitted to comint mode process by comint-send-input.
  32. Thus it can, for instance, track cd/pushd/popd commands issued to the csh.")
  33.  
  34. (defvar comint-input-filter (function (lambda (str) (not (string-match "\\`\\s *\\'" str)))) "\
  35. Predicate for filtering additions to input history.
  36. Only inputs answering true to this function are saved on the input
  37. history list. Default is to save anything that isn't all whitespace")
  38.  
  39. (defvar comint-input-sender (function comint-simple-send) "\
  40. Function to actually send to PROCESS the STRING submitted by user.
  41. Usually this is just 'comint-simple-send, but if your mode needs to 
  42. massage the input string, this is your hook. This is called from
  43. the user command comint-send-input. comint-simple-send just sends
  44. the string plus a newline.")
  45.  
  46. (defvar comint-eol-on-send (quote T) "\
  47. If non-nil, then jump to the end of the line before sending input to process.
  48. See COMINT-SEND-INPUT")
  49.  
  50. (defvar comint-mode-hook (quote nil) "\
  51. Called upon entry into comint-mode
  52. This is run before the process is cranked up.")
  53.  
  54. (defvar comint-exec-hook (quote nil) "\
  55. Called each time a process is exec'd by comint-exec.
  56. This is called after the process is cranked up.  It is useful for things that
  57. must be done each time a process is executed in a comint-mode buffer (e.g.,
  58. (process-kill-without-query)). In contrast, the comint-mode-hook is only
  59. executed once when the buffer is created.")
  60.  
  61. (defvar comint-mode-map nil)
  62.  
  63. (defun comint-mode nil "\
  64. Major mode for interacting with an inferior interpreter.
  65. Interpreter name is same as buffer name, sans the asterisks.
  66. Return at end of buffer sends line as input.
  67. Return not at end copies rest of line to end and sends it.
  68. Setting mode variable comint-eol-on-send means jump to the end of the line
  69. before submitting new input.
  70.  
  71. This mode is typically customised to create inferior-lisp-mode,
  72. shell-mode, etc.. This can be done by setting the hooks
  73. comint-input-sentinel, comint-input-filter, comint-input-sender and
  74. comint-get-old-input to appropriate functions, and the variable
  75. comint-prompt-regexp to the appropriate regular expression.
  76.  
  77. An input history is maintained of size input-ring-size, and
  78. can be accessed with the commands comint-next-input [\\[comint-next-input]] and 
  79. comint-previous-input [\\[comint-previous-input]]. Commands not keybound by
  80. default are send-invisible, comint-dynamic-complete, and 
  81. comint-list-dynamic-completions.
  82.  
  83. If you accidentally suspend your process, use \\[comint-continue-subjob]
  84. to continue it.
  85.  
  86. \\{comint-mode-map}
  87.  
  88. Entry to this mode runs the hooks on comint-mode-hook" (interactive) (byte-code "╠ê═┴╬ \"à╧┴!à     ╨ëê╤ëê╥ëê╙!ê╘╚!ê╒ ëê╘╔!ê╓ë    ê╘╫!ê╘╦!ê╘┴!ê╘╩!ê╪ë
  89. ê╘┘!ê╘┌!ê╘█!ê╘▄!ê╘▌!ê╘├!ê
  90. ëê╘▐!ê▀α!êß!â|éÇΓ !ë*ç" [old-ring input-ring old-ptyp comint-ptyp major-mode mode-name mode-line-process comint-mode-map comint-last-input-end comint-last-input-match input-ring-index input-ring-size nil assq buffer-local-variables boundp comint-mode "Comint" (": %s") use-local-map make-local-variable make-marker "" comint-prompt-regexp 0 comint-get-old-input comint-input-sentinel comint-input-filter comint-input-sender comint-eol-on-send comint-exec-hook run-hooks comint-mode-hook ring-p make-ring] 23))
  91.  
  92. (if comint-mode-map nil (setq comint-mode-map (make-sparse-keymap)) (define-key comint-mode-map "p" (quote comint-previous-input)) (define-key comint-mode-map "n" (quote comint-next-input)) (define-key comint-mode-map "s" (quote comint-previous-similar-input)) (define-key comint-mode-map "
  93. " (quote comint-send-input)) (define-key comint-mode-map "" (quote comint-delchar-or-maybe-eof)) (define-key comint-mode-map "" (quote comint-bol)) (define-key comint-mode-map "" (quote comint-kill-input)) (define-key comint-mode-map "" (quote backward-kill-word)) (define-key comint-mode-map "" (quote comint-interrupt-subjob)) (define-key comint-mode-map "" (quote comint-stop-subjob)) (define-key comint-mode-map "" (quote comint-quit-subjob)) (define-key comint-mode-map "" (quote comint-kill-output)) (define-key comint-mode-map "Æ" (quote comint-previous-input-matching)) (define-key comint-mode-map "" (quote comint-show-output)))
  94.  
  95. (defun full-copy-sparse-keymap (km) "\
  96. Recursively copy the sparse keymap KM" (byte-code ":â┬@!┬A!Béç" [km t full-copy-sparse-keymap] 4))
  97.  
  98. (defun comint-check-proc (buffer) "\
  99. True if there is a process associated w/buffer BUFFER, and
  100. it is alive (status RUN or STOP). BUFFER can be either a buffer or the
  101. name of one" (byte-code "┬    !à
  102. ├!─>)ç" [proc buffer get-buffer-process process-status (run stop)] 4))
  103.  
  104. (defun make-comint (name program &optional startfile &rest switches) (byte-code "╞╟╚
  105. ╚Q!)╔!?à èqê╩ )ê╦
  106.  
  107. %ê)ç" [buffer default-major-mode name program startfile switches fundamental-mode get-buffer-create "*" comint-check-proc comint-mode comint-exec] 9))
  108.  
  109. (defvar comint-ptyp t "\
  110. True if communications via pty; false if by pipe. Buffer local.
  111. This is to work around a bug in emacs process signalling.")
  112.  
  113. (defun comint-exec (buffer name command startfile switches) "\
  114. Fires up a process in buffer for comint modes.
  115. Blasts any old process running in the buffer. Doesn't set the buffer mode.
  116. You can use this to cheaply run a series of processes in the same comint
  117. buffer. The hook comint-exec-hook is run after each exec." (byte-code "èqê╚!    à╔    !)ê╩
  118. $╦┼!êëêdbê╠═    !`\"êàN╬╧!êdbê╨!ê╤`d\"ëê╥`d\"ê╙    \"ê╘╒!ê))ç" [buffer proc name command switches comint-ptyp process-connection-type startfile get-buffer-process delete-process comint-exec-1 make-local-variable set-marker process-mark sleep-for 1 insert-file-contents buffer-substring delete-region comint-send-string run-hooks comint-exec-hook] 13))
  119.  
  120. (defun comint-exec-1 (name buffer command switches) (byte-code "╚└!â╔╩╦╠ \"═╬E\"╧╨    
  121. %)éI╤╥!╤╙!╤╘!╒Ä╓╥╩╫╠ \"\"ê╓╙╪\"ê╓╘┘\"ê╧╨    
  122. %)+ç" [process-environment name buffer command switches tcapv termv emv boundp comint-update-env format "TERMCAP=emacs:co#%d:tc=unknown" screen-width "TERM=emacs" "EMACS=t" apply start-process getenv "TERMCAP" "TERM" "EMACS" ((byte-code "├─\"ê├┼    \"ê├╞
  123. \"ç" [tcapv termv emv setenv "TERMCAP" "TERM" "EMACS"] 5)) setenv "emacs:co#%d:tc=unknown" "emacs" "t"] 19))
  124.  
  125. (defun comint-update-env (old-env new) (byte-code "╞    !╟╚    \" àC @╔╩ \"à ╦╠╦!O Aëê
  126. à+═
  127. \"?à>
  128. à8
  129. Bëê Bë*êé    ê╬!*ç" [ans new vars old-env vv var reverse mapcar (lambda (vv) (byte-code "┴┬\"à
  130. ├─├!Oç" [vv string-match "^[^=]*=" 0 match-end] 5)) string-match "^[^=]*=" 0 match-end comint-mem nreverse] 8))
  131.  
  132. (defun comint-mem (item list &optional elt=) "\
  133. Test to see if ITEM is equal to an item in LIST.
  134. Option comparison function ELT= defaults to equal." (byte-code "å┼K┬ à    ?à)╞ @#â! ëé% Aëêé    ê    *ç" [elt= done nil list item equal funcall] 6))
  135.  
  136. (defun ring-p (x) "\
  137. T if X is a ring; NIL otherwise." (byte-code ":à┴@!àA:à┴A@!à┬AA!ç" [x integerp vectorp] 4))
  138.  
  139. (defun make-ring (size) "\
  140. Make a ring that can contain SIZE elts" (byte-code "┬├─┬\\┴\"BBç" [size nil 1 0 make-vector] 5))
  141.  
  142. (defun ring-plus1 (index veclen) "\
  143. INDEX+1, with wraparound" (byte-code "    ├\\
  144. Uâ─é)ç" [new-index index veclen 1 0] 2))
  145.  
  146. (defun ring-minus1 (index veclen) "\
  147. INDEX-1, with wraparound" (byte-code "┬Uâ
  148.     é ├Zç" [index veclen 0 1] 2))
  149.  
  150. (defun ring-length (ring) "\
  151. Number of elts in the ring." (byte-code "    @    A@    AAG
  152. Xâ┼
  153. Z\\é!╞┼
  154. Z# Uâ,╟é- )+ç" [hd ring tl siz len 1 + 0] 5))
  155.  
  156. (defun ring-empty-p (ring) (byte-code "┴┬!Uç" [ring 0 ring-length] 3))
  157.  
  158. (defun ring-insert (ring item) "\
  159. Insert a new item onto the ring. If the ring is full, dump the oldest
  160. item to make room." (byte-code "    AAG┼    @
  161. \"╞     \"ê Iê╟    !à'╞    A┼    A@
  162. \"\"+ç" [vec ring len new-hd item ring-minus1 setcar ring-empty-p] 8))
  163.  
  164. (defun ring-remove (ring) "\
  165. Remove the oldest item retained on the ring." (byte-code "├!â ─┼!é\"A@AA╞A╟    
  166. G\"\"ê
  167.     H*ç" [ring tl vec ring-empty-p error "Ring empty" setcar ring-minus1] 7))
  168.  
  169. (defun ring-rotate (ring n) (byte-code "╞U?àw╟    !â╚╔!éw    @    A@    AA G╞VàE╩
  170. \"ëê         
  171. HIê╩
  172.  
  173. \"ëê╦Zëêé!ê╞Wàj╠
  174.  
  175. \"ëê
  176. HIê╠
  177. \"ëê╦ZëêéF)ê═    
  178. \"ê═    A \"+ç" [n ring hd tl vec len 0 ring-empty-p error "ring empty" ring-plus1 1 ring-minus1 set-car] 10))
  179.  
  180. (defun comint-mod (n m) "\
  181. Returns N mod M. M is positive. Answer is guaranteed to be non-negative, 
  182. and less than m." (byte-code "┬    \"├Yâé    ├Yâ    é    [\\)ç" [n m % 0] 4))
  183.  
  184. (defun ring-ref (ring index) (byte-code "╟    !╚Uâ╔╩!é.    @    A@    AA╦
  185. \"╦
  186. \\ G\" H-)ç" [numelts ring hd tl vec index vec-index ring-length 0 error "indexed empty ring" comint-mod] 6))
  187.  
  188. (defun comint-previous-input (arg) "\
  189. Cycle backwards through input history." (interactive "*p") (byte-code "╟ê╚    !╔Xâ╩╦!ê╠ éx═ ?â$╩╬!ê╠ éx ╧=â2╨╤ `\"é^ ╥=âC╨╙╘p!!`\"é^
  190. ╔VâM╒éX
  191. ╔WâW╓éX╔ëê╫`!ê╪
  192. \\\"ëê╩┘ T\"ê┌     \"cê╧ë)ç" [len input-ring t last-command input-ring-index arg this-command nil ring-length 0 message "Empty input ring" ding comint-after-pmark-p "Not after process mark" comint-previous-input delete-region mark comint-previous-similar-input process-mark get-buffer-process -1 1 push-mark comint-mod "%d" ring-ref] 17))
  193.  
  194. (defun comint-next-input (arg) "\
  195. Cycle forwards through input history." (interactive "*p") (byte-code "┴ê┬[!ç" [arg nil comint-previous-input] 2))
  196.  
  197. (defvar comint-last-input-match "" "\
  198. Last string searched for by comint input history search, for defaulting.
  199. Buffer local variable.")
  200.  
  201. (defun comint-previous-input-matching (str) "\
  202. Searches backwards through input history for substring match." (interactive (byte-code "├─┼
  203. \"!╞    ╟\"â
  204. é    C*ç" [last-command s comint-last-input-match read-from-minibuffer format "Command substring (default %s): " string= ""] 5)) (byte-code "╩ê ëê╦=?à╠ëê═ !╬! ╧\\
  205. Wà0╨ ╤\"\"?à>╧\\ëêéê
  206. WâO╦ Z!é`╦=àY╦ë    ê╥╙!ê╘ +ç" [last-command s comint-last-input-match str input-ring-index len input-ring n t this-command nil comint-previous-input -1 regexp-quote ring-length 1 string-match ring-ref message "Not found." ding] 8))
  207.  
  208. (defvar comint-last-similar-string "" "\
  209. The string last used in a similar string search.")
  210.  
  211. (defun comint-previous-similar-input (arg) "\
  212. Reenters the last input that matches the string typed so far.  If repeated 
  213. successively older inputs are reentered.  If arg is 1, it will go back
  214. in the history, if -1 it will go forward." (interactive "p") (byte-code "╩ê╦ ?à ╠═!ê╬=?à╧╨╤╥p!!`\"ëê
  215. G╙
  216. !    \\╩ WàN╘
  217. \"ëG WåN╒
  218. ╓ O\"?à]\\ëêé0ê Wâàëê╬=âx╫╪ `\"é{┘`!ê ╩OcéÅ┌█!ê▄ ê▌▐!ê┌▀    T\",ç" [last-command input-ring-index comint-last-similar-string size len input-ring n arg entry t nil comint-after-pmark-p error "Not after process mark" comint-previous-similar-input -1 buffer-substring process-mark get-buffer-process ring-length ring-ref equal 0 delete-region mark push-mark message "Not found." ding sit-for 1 "%d"] 17))
  219.  
  220. (defun comint-send-input nil "\
  221. Send input to process.  After the process output mark, sends all text
  222. from the process mark to point as input to the process.  Before the process
  223. output mark, calls value of variable comint-get-old-input to retrieve old
  224. input, copies it to the process mark, and sends it.  A terminal newline is
  225. also inserted into the buffer and sent to the process.  In either case, value
  226. of variable comint-input-sentinel is called on the input before sending it.
  227. The input is entered into the input history ring, if the value of variable
  228. comint-input-filter returns non-nil when called on the input.
  229.  
  230. If variable comint-eol-on-send is non-nil, then point is moved to the end of
  231. line before sending the input.
  232.  
  233. comint-get-old-input, comint-input-sentinel, and comint-input-filter are chosen
  234. according to the command interpreter running in the buffer. E.g.,
  235. If the interpreter is the csh,
  236.     comint-get-old-input is the default: take the current line, discard any
  237.         initial string matching regexp comint-prompt-regexp.
  238.     comint-input-sentinel monitors input for \"cd\", \"pushd\", and \"popd\" 
  239.         commands. When it sees one, it cd's the buffer.
  240.     comint-input-filter is the default: returns T if the input isn't all white
  241.     space.
  242.  
  243. If the comint is Lucid Common Lisp, 
  244.     comint-get-old-input snarfs the sexp ending at point.
  245.     comint-input-sentinel does nothing.
  246.     comint-input-filter returns NIL if the input matches input-filter-regexp,
  247.         which matches (1) all whitespace (2) :a, :c, etc.
  248.  
  249. Similarly for Soar, Scheme, etc.." (interactive) (byte-code "╠ê═p!?â╬╧!éf╨!╤    !`
  250. Yâ- à%╥ ê╙    `\"é:╘!    bê
  251. )╒cê╘ \"àK╓ \"ê╘     \"ê╘
  252. #ê╫╨!`\"ê╫ `\"+)ç" [proc pmark pmark-val input comint-eol-on-send copy comint-get-old-input comint-input-filter input-ring comint-input-sentinel comint-input-sender comint-last-input-end nil get-buffer-process error "Current buffer has no process" process-mark marker-position end-of-line buffer-substring funcall 10 ring-insert set-marker] 16))
  253.  
  254. (defun comint-get-old-input-default nil "\
  255. Default for comint-get-old-input: take the current line, and discard
  256. any initial text matching comint-prompt-regexp." (byte-code "è┴ ê┬ ê`├ ê─`\"))ç" [beg beginning-of-line comint-skip-prompt end-of-line buffer-substring] 6))
  257.  
  258. (defun comint-skip-prompt nil "\
  259. Skip past the text matching regexp comint-prompt-regexp. 
  260. If this takes us past the end of the current line, don't skip at all." (byte-code "è┬ ê`)├    !à─┼!Xà─┼!b)ç" [eol comint-prompt-regexp end-of-line looking-at match-end 0] 5))
  261.  
  262. (defun comint-after-pmark-p nil "\
  263. Is point after the process output marker?" (byte-code "┴┬├p!!!`X)ç" [proc-pos marker-position process-mark get-buffer-process] 5))
  264.  
  265. (defun comint-simple-send (proc string) "\
  266. Default function for sending to PROC input STRING.
  267. This just sends STRING plus a newline. To override this,
  268. set the hook COMINT-INPUT-SENDER." (byte-code "┬    \"ê┬├\"ç" [proc string comint-send-string "
  269. "] 4))
  270.  
  271. (defun comint-bol (arg) "\
  272. Goes to the beginning of line, then skips past the prompt, if any.
  273. If a prefix argument is given (\\[universal-argument]), then no prompt skip 
  274. -- go straight to column 0.
  275.  
  276. The prompt skip is done by skipping text matching the regular expression
  277. comint-prompt-regexp, a buffer local variable.
  278.  
  279. If you don't like this command, reset c-a to beginning-of-line 
  280. in your hook, comint-mode-hook." (interactive "P") (byte-code "┴ê┬ ê?à ├ ç" [arg nil beginning-of-line comint-skip-prompt] 3))
  281.  
  282. (defun comint-read-noecho (prompt &optional stars) "\
  283. Prompt the user with argument PROMPT. Read a single line of text
  284. without echoing, and return it. Note that the keystrokes comprising
  285. the text can still be recovered (temporarily) with \\[view-lossage]. This
  286. may be a security bug for some applications. Optional argument STARS
  287. causes input to be echoed with '*' characters on the prompt line." (byte-code "╟┬╚╔
  288. ;?à╚ëê╩
  289. !êrë╦Uå! ╠U?à? ═ !Pëêà7
  290. ╬Pëê╩
  291. !êéê╩╚!ê ,ç" [echo-keystrokes cursor-in-echo-area t answ tem prompt stars 0 "" nil message 13 10 char-to-string "*"] 5))
  292.  
  293. (defun send-invisible (str) "\
  294. Read a string without echoing, and send it to the process running
  295. in the current buffer. A new-line is additionally sent. String is not 
  296. saved on comint input history list.
  297. Security bug: your string can still be temporarily recovered with
  298. \\[view-lossage]." (interactive "P") (byte-code "├ê─p!?â┼╞!é&╟    ;â    é ╚╔┬\"\"ê╟╩\")ç" [proc str t nil get-buffer-process error "Current buffer has no process" comint-send-string comint-read-noecho "Non-echoed text: " "
  299. "] 7))
  300.  
  301. (defvar comint-input-chunk-size 512 "\
  302. *Long inputs send to comint processes are broken up into chunks of this size.
  303. If your process is choking on big inputs, try lowering the value.")
  304.  
  305. (defun comint-send-string (proc str) "\
  306. Send PROCESS the contents of STRING as input.
  307. This is equivalent to process-send-string, except that long input strings
  308. are broken up into chunks of size comint-input-chunk-size. Processes
  309. are given a chance to output between chunks. This can help prevent processes
  310. from hanging when you send them long inputs on some OS's." (byte-code "    G ^╞     ╟
  311. O\"ê
  312. Wà.
  313. \\╚ ê╞     
  314. ^O\"ê
  315. ë)êé*ç" [len str i comint-input-chunk-size proc next-i process-send-string 0 accept-process-output] 9))
  316.  
  317. (defun comint-send-region (proc start end) "\
  318. Sends to PROC the region delimited by START and END.
  319. This is a replacement for process-send-region that tries to keep
  320. your process from hanging on long inputs. See comint-send-string." (byte-code "├─    
  321. \"\"ç" [proc start end comint-send-string buffer-substring] 5))
  322.  
  323. (defun comint-kill-output nil "\
  324. Kill all output from interpreter since last input." (interactive) (byte-code "┬ê├─p!!┼    \"êbê╞cê╟`\")ç" [pmark comint-last-input-end nil process-mark get-buffer-process kill-region "*** output flushed ***
  325. " set-marker] 6))
  326.  
  327. (defun comint-show-output nil "\
  328. Display start of this batch of interpreter output at top of window.
  329. Also put cursor there." (interactive) (byte-code "┴êbê┬ ê├ ê─┼ `\"ê╞ ç" [comint-last-input-end nil backward-char beginning-of-line set-window-start selected-window end-of-line] 6))
  330.  
  331. (defun comint-interrupt-subjob nil "\
  332. Interrupt the current subjob." (interactive) (byte-code "└ê┬└    \"ç" [nil comint-ptyp interrupt-process] 3))
  333.  
  334. (defun comint-kill-subjob nil "\
  335. Send kill signal to the current subjob." (interactive) (byte-code "└ê┬└    \"ç" [nil comint-ptyp kill-process] 3))
  336.  
  337. (defun comint-quit-subjob nil "\
  338. Send quit signal to the current subjob." (interactive) (byte-code "└ê┬└    \"ç" [nil comint-ptyp quit-process] 3))
  339.  
  340. (defun comint-stop-subjob nil "\
  341. Stop the current subjob.
  342. WARNING: if there is no current subjob, you can end up suspending
  343. the top-level process running in the buffer. If you accidentally do
  344. this, use \\[comint-continue-subjob] to resume the process. (This
  345. is not a problem with most shells, since they ignore this signal.)" (interactive) (byte-code "└ê┬└    \"ç" [nil comint-ptyp stop-process] 3))
  346.  
  347. (defun comint-continue-subjob nil "\
  348. Send CONT signal to process buffer's process group.
  349. Useful if you accidentally suspend the top-level process." (interactive) (byte-code "└ê┬└    \"ç" [nil comint-ptyp continue-process] 3))
  350.  
  351. (defun comint-kill-input nil "\
  352. Kill all text from last stuff output by interpreter to point." (interactive) (byte-code "┬ê├─p!!┼!`    Và╞`\"*ç" [pmark p-pos nil process-mark get-buffer-process marker-position kill-region] 6))
  353.  
  354. (defun comint-delchar-or-maybe-eof (arg) "\
  355. Delete ARG characters forward, or send an EOF to process if at end of buffer." (interactive "p") (byte-code "┴êmâ ┬ é├!ç" [arg nil process-send-eof delete-char] 3))
  356.  
  357. (defun comint-source-default (previous-dir/file source-modes) (byte-code "à    
  358. >â╟!╚!Bé å
  359. ╞Bç" [buffer-file-name major-mode source-modes previous-dir/file t default-directory nil file-name-directory file-name-nondirectory] 4))
  360.  
  361. (defun comint-check-source (fname) (byte-code "├    !à─!à┼╞╟╚!\"!à$pqê╔ ê
  362. q))ç" [buff fname old-buffer get-file-buffer buffer-modified-p y-or-n-p format "Save buffer %s first? " buffer-name save-buffer] 7))
  363.  
  364. (defun comint-extract-string nil "\
  365. Returns string around point that starts the current line or nil." (byte-code "è`╞ ê`╟ ê`bê╚╔    ─#à`Tbê╩╔
  366. ─#à(`S à5
  367. à5╦
  368. \"-)ç" [point bol eol start t end beginning-of-line end-of-line search-backward "\"" search-forward buffer-substring] 7))
  369.  
  370. (defun comint-get-source (prompt prev-dir/file source-modes mustmatch-p) (byte-code "╩    
  371. \"╦  à╠═╬Åà╧ !? â\"╨ !é$@ â/╤ !é1A╥âC╙╘#éE
  372.  
  373. P    $╒╓!!C.ç" [def prev-dir/file source-modes stringfile sfile-p defdir deffile ans prompt mustmatch-p comint-source-default comint-extract-string nil (byte-code "┴!ç" [stringfile file-exists-p] 2) ((error (byte-code "└ç" [nil] 1))) file-directory-p file-name-directory file-name-nondirectory read-file-name format "%s(default %s) " expand-file-name substitute-in-file-name] 11))
  374.  
  375. (defun comint-proc-query (proc str) (byte-code "╟    !╚    !╔!êqê╩!╦
  376. !╠    
  377. \"ê═    !ê╬ \"?àL╧ !╨
  378. \"ê╤╥!ê╬ \"?âF╙!éK╨ \")**ç" [proc-buf proc proc-mark proc-win proc-pt str opoint process-buffer process-mark display-buffer get-buffer-window marker-position comint-send-string accept-process-output pos-visible-in-window-p window-point set-window-point sit-for 0 push-mark] 16))
  379.  
  380. (defun comint-match-partial-pathname nil "\
  381. Returns the filename at point or causes an error." (byte-code "è┴┬└├#à ─┼!ê╞╟!?à╚╔!ê╩╦!ê╠═╬╧!╨╧!\"!)ç" [nil re-search-backward "[^~/A-Za-z0-9---_.$#,=@%+:]" move forward-char 1 looking-at "[~/A-Za-z0-9---_.$#,=@%+:]" error "" re-search-forward "[~/A-Za-z0-9---_.$#,=@%+:]+" substitute-in-file-name buffer-substring match-beginning 0 match-end] 11))
  382.  
  383. (defun comint-replace-by-expanded-filename nil "\
  384. Replace the filename at point with an expanded, canonicalised, and
  385. completed replacement.
  386. \"Expanded\" means environment variables (e.g., $HOME) and ~'s are
  387. replaced with the corresponding directories.  \"Canonicalised\" means ..
  388. and . are removed, and the filename is made absolute instead of relative.
  389. See functions expand-file-name and substitute-in-file-name. See also
  390. comint-dynamic-complete." (interactive) (byte-code "╞ê╟ ╚!╔!╩
  391.     å \" ?â%╦╠\"ê═ é@ ┼=â1╦╬!é@╧╨╤!╥╤!\"ê╙     P!c,ç" [pathname pathdir pathnondir completion default-directory t nil comint-match-partial-pathname file-name-directory file-name-nondirectory file-name-completion message "No completions of %s." ding "Unique completion." delete-region match-beginning 0 match-end expand-file-name] 13))
  392.  
  393. (defun comint-dynamic-complete nil "\
  394. Dynamically complete the filename at point.
  395. This function is similar to comint-replace-by-expanded-filename, except
  396. that it won't change parts of the filename already entered in the buffer; 
  397. it just adds completion characters to the end of the filename." (interactive) (byte-code "╞ê╟ ╚!╔!╩
  398.     å \" ?â%╦╠\"ê═ é< ┼=â1╦╬!é<╧╨!bê
  399. G╞Oc,ç" [pathname pathdir pathnondir completion default-directory t nil comint-match-partial-pathname file-name-directory file-name-nondirectory file-name-completion message "No completions of %s." ding "Unique completion." match-end 0] 11))
  400.  
  401. (defun comint-dynamic-list-completions nil "\
  402. List in help buffer all possible completions of the filename at point." (interactive) (byte-code "╔ê╩ ╦!╠!═
  403.     å \" ?â%╬╧\"ê╨ éP╤ ╥É╙ !æê╘╒!ê╬╓!êr╫UâI╪!éNë)),ç" [pathname pathdir pathnondir completions default-directory t conf ch unread-command-char nil comint-match-partial-pathname file-name-directory file-name-nondirectory file-name-all-completions message "No completions of %s." ding current-window-configuration "*Help*" display-completion-list sit-for 0 "Hit space to flush." 32 set-window-configuration] 13))
  404.  
  405. (defvar comint-load-hook nil "\
  406. This hook is run when comint is loaded in.
  407. This is a good place to put keybindings.")
  408.  
  409. (run-hooks (quote comint-load-hook))
  410.